bootloader: Add a zipl bootloader backend
authorColin Walters <walters@verbum.org>
Mon, 14 Oct 2019 19:22:19 +0000 (19:22 +0000)
committerColin Walters <walters@verbum.org>
Wed, 16 Oct 2019 14:22:02 +0000 (14:22 +0000)
commitc61234a428ee5daa75eea6524c50b7f11c7788ca
tree83b789145f6f8081c8dd23418cb1e38369953842
parentf203a4fc74581183e259bcd8ac515529d65abae8
bootloader: Add a zipl bootloader backend

zipl is a bit special in that it parses the BLS config files
directly *but* we need to run the command to update the "boot block".

Hence, we're not generating a separate config file like the other
backends.  Instead, extend the bootloader interface with a `post_bls_sync`
method that is run in the same place we swap the `boot/loader` symlink.

We write a "stamp file" in `/boot` that says we need to run this command.
The reason we use stamp file is to prevent the case where the system is
interrupted after BLS file is updated, but before zipl is triggered,
then zipl boot records are not updated.
This opens the door to making things eventually-consistent/reconcilable
by later adding a systemd unit to run `zipl` if we're interrupted via
a systemd unit - I think we should eventually take this approach
everywhere rather than requiring `/boot/loader` to be a symlink.

Author: Colin Walters <walters@verbum.org>
Tested-by: Tuan Hoang <tmhoang@linux.ibm.com>
Co-Authored-By: Tuan Hoang <tmhoang@linux.ibm.com>
Makefile-libostree.am
src/libostree/ostree-bootloader-zipl.c [new file with mode: 0644]
src/libostree/ostree-bootloader-zipl.h [new file with mode: 0644]
src/libostree/ostree-bootloader.c
src/libostree/ostree-bootloader.h
src/libostree/ostree-repo.c
src/libostree/ostree-sysroot-deploy.c